<?php

namespace App\Http\Middleware\CallingCards;

use Closure;
use Illuminate\Http\Request;

class WechatAuth
{
    /**
     * 验证飞书用户是否登录
     * @param Request $request
     * @param Closure $next
     * @return \Illuminate\Http\JsonResponse|mixed
     */
    public function handle(Request $request, Closure $next)
    {
        if (auth('callingCardsWeChat')->check()) {
            return $next($request);
        }
        return response()->json(['code' => 403, 'msg' => '尚未登录']);
    }
}
